package com.caiyi.tips.core.util;

import lombok.extern.slf4j.Slf4j;

import java.time.Duration;
import java.time.LocalDateTime;

@Slf4j
public final class DateUtil {
    private DateUtil() {
    }

    /**
     * 获得自然日剩余时间 秒
     *
     * @return
     */
    public static long getNaturalDayRemainingSeconds() {
        LocalDateTime start = LocalDateTime.now();
        LocalDateTime end = start.plusDays(1);

        end = LocalDateTime.of(end.getYear(), end.getMonth(), end.getDayOfMonth(), 0, 0);
        return Duration.between(start, end).getSeconds();
    }
}
